﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK;

namespace JAMR.Utils
{
    public static class MathExtensions
    {
        public static Matrix4 ShallowCopy(this Matrix4 m)
        {
            Matrix4 copy = new Matrix4(
                m.Row0, 
                m.Row1, 
                m.Row2, 
                m.Row3);

            return copy;
        }
        public static Matrix4 DeepCopy(this Matrix4 m)
        {
            Matrix4 copy = new Matrix4(
                m.M11, m.M12, m.M13, m.M14,
                m.M21, m.M22, m.M23, m.M24,
                m.M31, m.M32, m.M33, m.M34,
                m.M41, m.M42, m.M43, m.M44);

            return copy;
        }

        public static float Distance(this Vector3 t, Vector3 other)
        {
            Vector3 dist = t - other;

            return dist.LengthFast;
        }
    }
}
